package com.huawo.qjs.widgets;

import com.huawo.qjs.QjsDependence;
import com.huawo.qjs.QjsWidget;

import java.util.ArrayList;
import java.util.List;

public class QjsHourHand extends QjsWidget {

    private int width;
    private int height;

    public QjsHourHand(String name) {
        super(name);
    }

    /**
     * 控件名称（英文字母开头，全局唯一即可，不要太长）
     * @param name 英文字母开头，全局唯一即可，不要太长
     * @param color 控件颜色
     */
    public QjsHourHand(String name, int color,int width,int height) {
        super(name);
        this.setColor(color);
        this.width = width;
        this.height = height;
    }

    @Override
    public List<String> getImageNames() {
        List<String> list = new ArrayList<>();
        list.add("pointer_hour");
        return list;
    }

    @Override
    public List<QjsDependence> getDependences() {
        List<QjsDependence> dependences = new ArrayList<>();
        dependences.add(new QjsDependence("pointer", "pointer.js"));
        return dependences;
    }

    @Override
    public String start() {
        String iconPath = "pointer_hour";
        iconPath = iconPath + "_" +  getColor();
        iconPath = iconPath + ".bin";
        return pointerJS("_hour", HOUR_POINTER, iconPath,width,height);
    }
    public String Resume(){
        String iconPath = "pointer_hour.bin";
        iconPath ="pointer_hour" + "_" +  getColor() + ".bin";
        return pointerResumeJs("_hour",HOUR_POINTER, iconPath,index);
    }
}
